package com.zhongyouyun.admin.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongyouyun.admin.model.DictModel;
import com.zhongyouyun.admin.model.MenuModel;
import com.zhongyouyun.admin.model.RoleModel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhongyouyun.admin.pojo.RolePojo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * @Author: shenyi
 * @Date: 2021-09-23
 * @Description: 角色表Mapper
 */
@Mapper
public interface RoleMapper extends BaseMapper<RoleModel> {

    List<RoleModel> findByUserId(@Param("id") Long id);

    List<MenuModel> findRoleMenus(RoleModel roleModel);


    List<DictModel> findRoleDicts(RoleModel roleModel);

    IPage<RolePojo> selectPojoPage(Page page,@Param(Constants.WRAPPER) Wrapper query);
}
